<template>
  <div class="preview-modal" v-show="isShowPreview">
    <div class="preview-modal_title">
      <p>图片预览</p>
      <i class="iconfont icon-close" @click="closeModal"></i>
    </div>
    <div class="preview-modal_content">
      <img :src="imgSrc" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    imgSrc: {
      type: String,
      default: () => ''
    },
    isShowPreview: {
      type: Boolean,
      default: () => false
    }
  },
  methods: {
    closeModal() {
      this.$emit('update:isShowPreview', false)
    }
  }
}
</script>
